package com.songshuai.webapi.permission.dao;

import com.songshuai.webapi.permission.dto.request.RoleHomePageReqDto;
import com.songshuai.webapi.permission.dto.response.NavigationListResDto;
import com.songshuai.webapi.permission.model.YxRolesNavigations;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;

public interface YxRolesNavigationsMapper {

    int deleteByPrimaryKey(Integer id);

    int insert(YxRolesNavigations record);

    int insertSelective(YxRolesNavigations record);

    YxRolesNavigations selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(YxRolesNavigations record);

    int updateByPrimaryKey(YxRolesNavigations record);

    int deleteByRoleId(@Param("roleId") Integer roleId);

    int deleteRoleNavigations(YxRolesNavigations entity);

    //新增角色菜单关联
    int addRoleNavigationRelation(Map<String,Object> params);

    //根据AppId和角色Id查询所有一级菜单列表
    List<NavigationListResDto> queryParentNavigationList(RoleHomePageReqDto reqDto);

    //根据AppId和角色Id查询所有非一级菜单列表
    List<NavigationListResDto> queryAllChildNavigationList(RoleHomePageReqDto reqDto);

    int countByNavigationId(@Param("navigationId") Integer navigationId,@Param("roleId") Integer roleId);

    List<Integer> selectNavigationIdList(@Param("roleId") Integer roleId);

    /**
     * 根据角色获取菜单
     * @param roleId
     * @return
     */
    List<Integer> queryNavByRole(@Param("roleId")Integer roleId);

}